﻿Imports System.IO

Namespace TweeVo
	Public Enum LoggerSeverity
		Info
		[Error]
	End Enum

	Public Class Logger
		Public Shared Sub Log(ByVal msg As String, ByVal severity As LoggerSeverity)
			Debug.WriteLine(msg)

#If Not DEBUG Then
			If severity <> LoggerSeverity.Error Then
				Return
			End If
#End If

			Dim sw As StreamWriter = File.AppendText(Path.Combine(Path.GetTempPath(), "tweevo.txt"))

			Try
				sw.WriteLine(String.Format("{0} - {1:G}: {2}", severity, Date.Now, msg))
			Finally
				sw.Close()
			End Try
		End Sub
	End Class
End Namespace